﻿using Edu.Abstracts;
using Edu.Contracts;
using Edu.Pages;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace Edu.Web.Pages.StudyTask
{
    public class CreateModalModel : EduPageModelBase
    {
        private IStudyTaskCrudAppService _appService;






        [BindProperty]
        public StudyTaskCreateUpdateDto CreateUpdateDto { get; set; }

        public CreateModalModel(IStudyTaskCrudAppService appService)
        {
            _appService = appService;



        }



        public void OnGet()
        {

        }

        public async Task<IActionResult> OnPostAsync()
        {
            await _appService.CreateAsync(CreateUpdateDto);
            return NoContent();
        }
    }
}